]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: add an indicatorCount property
authorCosimo Cecchi <cosimoc@gnome.org>
Fri, 1 Mar 2013 02:25:05 +0000 (21:25 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Fri, 1 Mar 2013 18:17:51 +0000 (13:17 -0500)
This filters out resident and transient notifications in the normal
case, but just returns the number of unread messages for the Telepathy
implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=687787

js/ui/components/telepathyClient.js
js/ui/messageTray.js

index 72df82d679f33f3cf19fab2f8f07587fa33c6585..b07ea95167326767c2da25b2f0044643704a62d2 100644 (file)
@@ -640,6 +640,10 @@ const ChatSource = new Lang.Class({
         return this._pendingMessages.length;
     },
 
+    get indicatorCount() {
+        return this.count;
+    },
+
     get unseenCount() {
         return this.count;
     },
index 14c55db6319fd1e32e2a92fd7e4e8dc8ed800c2f..2df4abc488fc1340d47e40c5cdb9524ebf0ad384 100644 (file)
@@ -1153,6 +1153,11 @@ const Source = new Lang.Class({
         return this.notifications.length;
     },
 
+    get indicatorCount() {
+        let notifications = this.notifications.filter(function(n) { return !n.isTransient && !n.resident; });
+        return notifications.length;
+    },
+
     get unseenCount() {
         return this.notifications.filter(function(n) { return !n.acknowledged; }).length;
     },